package leetcode_1201_1300;

import java.util.*;

public class LeeCode_1200 {
    public static void main(String[] args) {

    }
    private static List<List<Integer>> minimumAbsDifference(int[] arr) {
        int n = arr.length;
        Arrays.sort(arr);
        TreeMap<Integer, List<List<Integer>>> map = new TreeMap<>();
        for (int i = 0; i < n - 1; i++) {
            List<Integer> list = new ArrayList<>();
            list.add(arr[i]);
            list.add(arr[i + 1]);
            int key = arr[i + 1] - arr[i];
            if (!map.containsKey(key)){
                map.put(key, new ArrayList<>());
            }
            map.get(key).add(list);
        }
        return map.firstEntry().getValue();
    }
}